package com.wang.config;

import org.apache.dubbo.config.RegistryConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

//@Configuration
public class NacosConfiguration {

/*    @Value("${nacos.config.server-addr}")
    private String nacosAddress;*/

/*    @Bean
    public NacosConfig nacosConfig() {
        NacosConfig config = new NacosConfig();
        String address = nacosAddress.split("//")[1];
        config.setServerAddr(address);
        config.setDataId(nacosConfigDataId);
        config.init();
        return config;
    }*/

/*    @Bean(name = "registryConfig")
    @Primary
    public RegistryConfig registryConfig() {
        RegistryConfig registryConfig = new RegistryConfig();
        registryConfig.setAddress("nacos://192.168.1.104:8848");
        return registryConfig;
    }

    @Bean(name = "otherRegistryConfig")
    public RegistryConfig otherRegistryConfig() {
        RegistryConfig registryConfig = new RegistryConfig();
        registryConfig.setAddress("nacos://staging-nacos.youpin.srv:80");
        return registryConfig;
    }*/

}
